package aps

import glory.xxd.Utils

/**
 * 点击开始作业按钮
 */
class StartProcessController {

    def commentService

    def index() {
        def EqpId = params.EqpId ?: ""
        def USERNAME = params.USERNAME ?: ""
        def LotId = params.LotId ?: ""
        def Remark =params.Remark?:''   //非必输项
        def TotalQty =params.TotalQty?:''
//        print TotalQty
        def body = CommentParams.newInstance()
        body.setEqpId(EqpId)
        body.setUSERNAME(USERNAME)
        body.setLotId(LotId)
        body.setTotalQty(TotalQty)
        if (Remark != null && Remark != ""){
            body.setRemark(Remark)
        }

        String logUUID = Utils.getUUID();
        Header header = Header.newInstance()
        header.setMESSAGENAME("StartProcess");
        header.setTRANSACTIONID(logUUID);
        def json = commentService.getJsonByObjectForTopic2Queue(logUUID, header, body)
//        print "StartProcess: "+json
        render json
    }
}